import request from "@/utils/request.ts";
import Enum from "@/api/useApi/enum.ts";
import type { Response } from "@/types/commonTypes/commonTypes.ts";
import type { LoginParams, UserInfo } from "@/types/userTypes/userTypes.ts";
/*用户名和密码登录的接口*/
export const userNameLoginAPI = (data: LoginParams): Promise<Response<UserInfo>> => request.post<any, Response<UserInfo>>(Enum.userNameLogin, data);
/*发送验证码的接口*/
export const sendCodeAPI = (mobile: string): Promise<Response<any>> => request.get<any, Response<any>>(Enum.sendCode, { params: { mobile } });
/*手机和验证码登录的接口*/
export const userMobileLoginAPI = (data: LoginParams): Promise<Response<UserInfo>> => request.post<any, Response<UserInfo>>(Enum.userMobileLogin, data);
/*qq登录的接口*/
export const userQQLoginAPI = (unionId: string, source: number): Promise<Response<UserInfo>> => request.post<any, Response<UserInfo>>(Enum.userQQLogin, { unionId, source });
/*qq绑定时的验证码接口*/
export const qqBindSendCodeAPI = (mobile: string) => request.get(Enum.qqBindSendCode, { params: { mobile } });
/*绑定手机号的接口*/
export const qqBindMobileAPI = (mobile: string, code: string, unionId: string): Promise<Response<UserInfo>> => request.post<any, Response<UserInfo>>(Enum.qqBindMobile, { mobile, code, unionId });
